package com.yimi.policyservice.repository;

import com.yimi.policyservice.entity.base.policy.PolicyDisabilitiesProduct;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface PolicyDisabilitiesProductRepository extends JpaRepository<PolicyDisabilitiesProduct,String> {

    @Transactional
    @Modifying
    @Query(value = "delete from t_policy_disabilities_product where id in ?1",nativeQuery = true)
    void deleteByIdIn(List<String> ids);

    PolicyDisabilitiesProduct findFirstByAddrId(String optrCompId);
}
